/**
 * ControllerContext.java
 * com.ebook.core.controller.support
 * Copyright (c) 2013, 公司版权所有.
*/

package com.ebook.core.controller.support;

import javax.servlet.http.HttpServletRequest;

/**
 * Controller threadlocal缓存
 * <p>
 * 缓存异常转向
 * @author    潘吉友
 * @Date	 2013-7-29 	 
 */
public class ControllerContext {
	
	private static final ThreadLocal<HttpServletRequest> REQUESTS = new ThreadLocal<HttpServletRequest>();

	public static HttpServletRequest getRequest() {
		return REQUESTS.get();
	}
	
	public static void setRequest(HttpServletRequest request){
		REQUESTS.set(request);
	}

	
	public static void clear() {
		REQUESTS.remove();
	}
	

}

